package com.mdb.open.common.enums.trade.type;

import com.google.common.collect.Lists;
import com.mdb.bc.api.enums.ApiEnum;

import java.util.List;

/** 
 * @description:融资申请审批流程时序图
 * @author: you.yichao
 * @create: 2019-07-06 18:14
 **/
public enum ProcessLogTypeEnum implements ApiEnum<String> {

    /**
     * 融资申请审批流程时序图
     */
    APPLY_COMMIT("提交申请", "审批中", "业务待审核") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REVIEW);
        }

        @Override
        public List<ProcessLogTypeEnum> getProcessLogTypeEnumList() {
            return Lists.newArrayList(ProcessLogTypeEnum.APPLY_COMMIT, ProcessLogTypeEnum.BIZ_WAIT_APPROVE);
        }
    },
    BIZ_WAIT_APPROVE("业务待审批", "审批中", "业务待审核") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.UN_VISIBLE;
        }
    },

    BIZ_APPROVE_SUCCESS("业务审核通过", "审批中", "业务审核通过") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.UN_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REVIEW);
        }
    },
    BIZ_APPROVE_REJECT("业务审核不通过", "审批拒绝", "拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REJECT);
        }
    },
    AML_PROCESSING("反洗钱审核中", "审批中", "反洗钱审核中") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.UN_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REVIEW);
        }
    },
    AML_APPROVE_REJECT("反洗钱审核拒绝", "审批拒绝", "拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REJECT);
        }
    },
    AML_APPROVE_SUCCESS("反洗钱审核通过", "审批中", "风控人工待审核") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.UN_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REVIEW);
        }
    },
    RISK_APPROVE_SUCCESS("风控人工审核通过", "审批中", "风控模型待审核") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.UN_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REVIEW);
        }
    },
    RISK_APPROVE_REJECT("风控人工审核不通过", "审批中", "业务待审核") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.UN_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REVIEW);
        }
    },
    RISK_SYS_APPROVE_SUCCESS("风控模型通过", "待提款", "待提款") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_APPROVE);
        }
    },
    RISK_SYS_APPROVE_REJECT("风控模型不通过", "审批拒绝", "拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REJECT);
        }
    },
    LOAN_CONTRACT_EXPIRED("提款日过期", "提款失效", "提款拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_CONTRACT_EXPIRED);
        }
    },
    LOAN_CONTRACT_WAIT_UPLOAD("待上传提款申请书", "待上传申请书", "待上传申请书") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_CONTRACT_WAIT_UPLOAD);
        }
    },
    LOAN_CONTRACT_WAIT_APPROVE("提款申请待审批", "提款申请待审批", "提款待审批") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_CONTRACT_WAIT_APPROVE);
        }
    },
    LOAN_CONTRACT_REJECT("提款审批拒绝", "提款审批拒绝", "提款审批拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_CONTRACT_REJECT);
        }
    },
    LOAN_CONTRACT_SUCCESS("提款成功", "待放款", "待放款") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_CONTRACT_SUCCESS);
        }
    },
    LOAN_REMIT_SUCCESS("核心放款成功", "正常待还", "正常待还") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }

        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_REMIT_SUCCESS);
        }
    },
    OVERDUE("逾期", "逾期待还", "逾期待还") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }
        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.OVERDUE);
        }
    },
    PREPAYMENT("提前结清", "提前完结", "提前结清") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }
        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.PREPAYMENT);
        }
    },
    NORMAL_REPAYMENT("正常结清", "正常完结", "正常结清") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }
        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.NORMAL_REPAYMENT);
        }
    },
    OVERDUE_REPAYMENT("逾期结清", "逾期完结", "逾期结清") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }
        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.OVERDUE_REPAYMENT);
        }
    },
    CLAIM_APPLY_REJECT("认领导致申请拒绝", "提款失效", "提款拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }
        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.APPLY_REJECT);
        }
    },
    CLAIM_LOAN_REJECT("认领导致借据签署拒绝", "提款失效", "提款拒绝") {
        @Override
        public FlowCusVisibleTypeEnum getVisibleType() {
            return FlowCusVisibleTypeEnum.IS_VISIBLE;
        }
        @Override
        public List<FlowCusTypeEnum> getCusTypeEnumList() {
            return Lists.newArrayList(FlowCusTypeEnum.LOAN_CONTRACT_EXPIRED);
        }
    },
    ;

    ProcessLogTypeEnum(String text, String cusText, String bizText) {
        this.text = text;
        this.cusText = cusText;
        this.bizText = bizText;
    }

    /**
     * 枚举描述
     */
    private String text;

    /**
     * 枚举描述
     */
    private String cusText;

    /**
     * 枚举描述
     */
    private String bizText;
    /**
     * 分组函数
     *
     * @return
     */
    public abstract FlowCusVisibleTypeEnum getVisibleType();

    List<ProcessLogTypeEnum> processLogTypeEnumList;

    public List<ProcessLogTypeEnum> getProcessLogTypeEnumList() {
        return processLogTypeEnumList;
    }

    List<FlowCusTypeEnum> cusTypeEnumList;

    public List<FlowCusTypeEnum> getCusTypeEnumList() {
        return cusTypeEnumList;
    }


    @Override
    public String getValue() {
        return this.name();
    }

    @Override
    public String getText() {
        return this.text;
    }

    public String getCusText() {
        return cusText;
    }

    public String getBizText() {
        return bizText;
    }


}